Skip to content

feat(app): Window.SetTitle changes a window's title after it opens - #1

Merged
1lck merged 1 commit into
mainfrom
feat/window-set-title
Nov 11, 2026
Merged

1lck merged 1 commit into
mainfrom
feat/window-set-title

Conversation

@1lck

@1lck 1lck commented Nov 11, 2026

Copy link
Copy Markdown

Changes

  • New app.Window.SetTitle(title string) error: changes the window title after the window opens. The title shows in the system title bar, the task switcher and the taskbar or Dock window list. It is safe to call from any goroutine. Hosts without support return an error that wraps ErrUnsupported.
  • macOS: viva_application_set_title sets the NSWindow title on the main thread and updates the delegate's _title.
  • Windows: the new title is stored first and then posted to the window thread as wmSetTitle (0x8052). The window thread applies it with SetWindowTextW and also updates the accessibility tree's window name. A direct call from another thread would block on WM_SETTEXT, so the change is posted instead.
  • Linux: the GTK toplevel title is set on the GTK thread.
  • headless: the new title appears in the windows listing.
  • README and docs/conformance.md updated; unit test TestSetTitleDelegatesToTheHost added.

Purpose: Lithe IDE (1lck/Lithe-IDEA#1799) needs the window title and the Windows taskbar entry to follow the current project and file.

🤖 Generated with Claude Code

macOS sets the NSWindow title on the main thread; Windows posts the change to
the window thread and applies it with SetWindowTextW (a direct call from
another thread would block on WM_SETTEXT); Linux sets the GTK toplevel title
on the GTK thread; the headless host records it in its windows listing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1lck
1lck merged commit fc9a595 into main Nov 11, 2026
@1lck
1lck deleted the feat/window-set-title branch November 11, 2026 07:29
xiaoyumuxi added a commit that referenced this pull request Nov 14, 2026
Upstream's wmSetSize and the fork's wmSetTitle (#1) both took 0x8052, so the
window procedure's switch has a duplicate case once both are on main (#16) and
the Windows platform package does not compile. wmSetTitle moves to 0x8053, the
next number no private message uses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant